.SUFFIXES : .ml .mli .cmx .cmi .mly .mll .cmo

MLFILES         = vrp.ml nosubtour.ml bound.ml model.ml main.ml
CMXFILES        = $(MLFILES:.ml=.cmx)
CMOFILES        = $(CMXFILES:.cmx=.cmo)


CAML            = ocamlc -g -dtypes
CAMLYACC        = ocamlyacc
CAMLLEX         = ocamllex

CAMLOPT		= ocamlopt -unsafe -inline 100 -dtypes

FCL             = facile.cmxa

LIBS		= -I ../Libs -I +facile
CMXLIB		= utils.cmx target.cmx uav_data.cmx
CMOLIB		= $(CMXLIB:.cmx=.cmo)

all: planner.out $(CMOFILES)

planner.out: $(CMXFILES)
	@echo OL $(FCL) $(CMXFILES) to $@
	@$(CAMLOPT)  $(LIBS) graphics.cmxa $(FCL) $(CMXLIB) $(CMXFILES) -o $@

#card.out: card.ml
#	@$(CAMLOPT) $(LIBS) $(FCL) $(CMXLIB) card.ml -o card.out

cplan: cplan.ml
	$(CAMLOPT) $(LIBS) facile.cmxa cplan.ml -o cp.out

.ml.cmo:
	@echo OC $<
	@$(CAML) $(LIBS) -c $<

.ml.cmx :
	@echo OC $<
	@$(CAMLOPT) $(LIBS) -c $<

.mli.cmi :
	@echo OC $<
	@$(CAMLOPT) $(LIBS) -c $<

clean :
	@echo CLEAN
	@rm -f *.cm* \#*\# *.o *~  *.opt *.out .depend

.depend:
	ocamldep -native *.mli *.ml >.depend
include .depend
